package com.magenta.maxoptra.gis;

import java.util.List;

/**
 * Interface for synchronized requests to external geo-coding providers.
 * @author ivictus
 *
 */
public interface SyncGeocodingService extends ISyncGeocodingService {
    public static final String JNDI_NAME = "SyncGeocodingService";

    List<GeoAddress> getAddress(GeoProviderSettings settings, String query) throws GeoException;

    GeoAddress getBestAddress(GeoProviderSettings settings, String query);

    GeoAddress getCountryAddress(GeoProviderSettings settings, String country);

    List<GeoAddress> doForwardGeocoding(GeoProviderSettings settings, GeoAddress address);

    GeoAddress getBestAddress(GeoProviderSettings settings, GeoAddress address);

//    @Deprecated
//    GeoAddress doReverseGeocoding(ProviderSettings params, GeoAddress address);

    /**
     * Clean expired cache and return date of first oldest entry
     *
     * @param maxAge minutes
     * @return date of first oldest entry
     */
    long cleanAndGetDateOfFirstOldest(long cid, long maxAge);
}
